package com.server.core.util;

import java.util.Properties;

public class PropertiesUtil {
    private Properties prop = new Properties();
    private static PropertiesUtil propertiesUtil = new PropertiesUtil();
    private PropertiesUtil() {
        this("config.properties");
    }
    private PropertiesUtil(String fileName) {
        super();
        try{
            prop.load( this.getClass().getClassLoader().getResourceAsStream(fileName));
        }catch (Exception e) {
            e.printStackTrace();
        }
    }

    public  String getProperty(String key) {
        String value = prop.getProperty(key.trim());
        if(value == null) {
            return "";
        }
        return value.trim();
    }

    public static  PropertiesUtil getInstance() {
        return  propertiesUtil;
    }


}
